3.105 \(\int (a+b \text {sech}^2(c+d x)) \tanh (c+d x) \, dx\)

Optimal. Leaf size=29 \[ \frac {a \log (\cosh (c+d x))}{d}-\frac {b \text {sech}^2(c+d x)}{2 d} \]

[Out]

a*ln(cosh(d*x+c))/d-1/2*b*sech(d*x+c)^2/d

________________________________________________________________________________________

Rubi [A]  time = 0.03, antiderivative size = 29, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.105, Rules used = {4138, 14} \[ \frac {a \log (\cosh (c+d x))}{d}-\frac {b \text {sech}^2(c+d x)}{2 d} \]

Antiderivative was successfully verified.

[In]

Int[(a + b*Sech[c + d*x]^2)*Tanh[c + d*x],x]

[Out]

(a*Log[Cosh[c + d*x]])/d - (b*Sech[c + d*x]^2)/(2*d)

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rule 4138

Int[((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^(n_))^(p_.)*tan[(e_.) + (f_.)*(x_)]^(m_.), x_Symbol] :> Module[{ff =
 FreeFactors[Cos[e + f*x], x]}, -Dist[(f*ff^(m + n*p - 1))^(-1), Subst[Int[((1 - ff^2*x^2)^((m - 1)/2)*(b + a*
(ff*x)^n)^p)/x^(m + n*p), x], x, Cos[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f, n}, x] && IntegerQ[(m - 1)/2] &&
IntegerQ[n] && IntegerQ[p]

Rubi steps

\begin {align*} \int \left (a+b \text {sech}^2(c+d x)\right ) \tanh (c+d x) \, dx &=\frac {\operatorname {Subst}\left (\int \frac {b+a x^2}{x^3} \, dx,x,\cosh (c+d x)\right )}{d}\\ &=\frac {\operatorname {Subst}\left (\int \left (\frac {b}{x^3}+\frac {a}{x}\right ) \, dx,x,\cosh (c+d x)\right )}{d}\\ &=\frac {a \log (\cosh (c+d x))}{d}-\frac {b \text {sech}^2(c+d x)}{2 d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.02, size = 29, normalized size = 1.00 \[ \frac {a \log (\cosh (c+d x))}{d}-\frac {b \text {sech}^2(c+d x)}{2 d} \]

Antiderivative was successfully verified.

[In]

Integrate[(a + b*Sech[c + d*x]^2)*Tanh[c + d*x],x]

[Out]

(a*Log[Cosh[c + d*x]])/d - (b*Sech[c + d*x]^2)/(2*d)

________________________________________________________________________________________

fricas [B]  time = 0.42, size = 359, normalized size = 12.38 \[ -\frac {a d x \cosh \left (d x + c\right )^{4} + 4 \, a d x \cosh \left (d x + c\right ) \sinh \left (d x + c\right )^{3} + a d x \sinh \left (d x + c\right )^{4} + a d x + 2 \, {\left (a d x + b\right )} \cosh \left (d x + c\right )^{2} + 2 \, {\left (3 \, a d x \cosh \left (d x + c\right )^{2} + a d x + b\right )} \sinh \left (d x + c\right )^{2} - {\left (a \cosh \left (d x + c\right )^{4} + 4 \, a \cosh \left (d x + c\right ) \sinh \left (d x + c\right )^{3} + a \sinh \left (d x + c\right )^{4} + 2 \, a \cosh \left (d x + c\right )^{2} + 2 \, {\left (3 \, a \cosh \left (d x + c\right )^{2} + a\right )} \sinh \left (d x + c\right )^{2} + 4 \, {\left (a \cosh \left (d x + c\right )^{3} + a \cosh \left (d x + c\right )\right )} \sinh \left (d x + c\right ) + a\right )} \log \left (\frac {2 \, \cosh \left (d x + c\right )}{\cosh \left (d x + c\right ) - \sinh \left (d x + c\right )}\right ) + 4 \, {\left (a d x \cosh \left (d x + c\right )^{3} + {\left (a d x + b\right )} \cosh \left (d x + c\right )\right )} \sinh \left (d x + c\right )}{d \cosh \left (d x + c\right )^{4} + 4 \, d \cosh \left (d x + c\right ) \sinh \left (d x + c\right )^{3} + d \sinh \left (d x + c\right )^{4} + 2 \, d \cosh \left (d x + c\right )^{2} + 2 \, {\left (3 \, d \cosh \left (d x + c\right )^{2} + d\right )} \sinh \left (d x + c\right )^{2} + 4 \, {\left (d \cosh \left (d x + c\right )^{3} + d \cosh \left (d x + c\right )\right )} \sinh \left (d x + c\right ) + d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sech(d*x+c)^2)*tanh(d*x+c),x, algorithm="fricas")

[Out]

-(a*d*x*cosh(d*x + c)^4 + 4*a*d*x*cosh(d*x + c)*sinh(d*x + c)^3 + a*d*x*sinh(d*x + c)^4 + a*d*x + 2*(a*d*x + b
)*cosh(d*x + c)^2 + 2*(3*a*d*x*cosh(d*x + c)^2 + a*d*x + b)*sinh(d*x + c)^2 - (a*cosh(d*x + c)^4 + 4*a*cosh(d*
x + c)*sinh(d*x + c)^3 + a*sinh(d*x + c)^4 + 2*a*cosh(d*x + c)^2 + 2*(3*a*cosh(d*x + c)^2 + a)*sinh(d*x + c)^2
 + 4*(a*cosh(d*x + c)^3 + a*cosh(d*x + c))*sinh(d*x + c) + a)*log(2*cosh(d*x + c)/(cosh(d*x + c) - sinh(d*x +
c))) + 4*(a*d*x*cosh(d*x + c)^3 + (a*d*x + b)*cosh(d*x + c))*sinh(d*x + c))/(d*cosh(d*x + c)^4 + 4*d*cosh(d*x
+ c)*sinh(d*x + c)^3 + d*sinh(d*x + c)^4 + 2*d*cosh(d*x + c)^2 + 2*(3*d*cosh(d*x + c)^2 + d)*sinh(d*x + c)^2 +
 4*(d*cosh(d*x + c)^3 + d*cosh(d*x + c))*sinh(d*x + c) + d)

________________________________________________________________________________________

giac [B]  time = 0.13, size = 80, normalized size = 2.76 \[ -\frac {2 \, a d x - 2 \, a \log \left (e^{\left (2 \, d x + 2 \, c\right )} + 1\right ) + \frac {3 \, a e^{\left (4 \, d x + 4 \, c\right )} + 6 \, a e^{\left (2 \, d x + 2 \, c\right )} + 4 \, b e^{\left (2 \, d x + 2 \, c\right )} + 3 \, a}{{\left (e^{\left (2 \, d x + 2 \, c\right )} + 1\right )}^{2}}}{2 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sech(d*x+c)^2)*tanh(d*x+c),x, algorithm="giac")

[Out]

-1/2*(2*a*d*x - 2*a*log(e^(2*d*x + 2*c) + 1) + (3*a*e^(4*d*x + 4*c) + 6*a*e^(2*d*x + 2*c) + 4*b*e^(2*d*x + 2*c
) + 3*a)/(e^(2*d*x + 2*c) + 1)^2)/d

________________________________________________________________________________________

maple [A]  time = 0.14, size = 29, normalized size = 1.00 \[ -\frac {b \mathrm {sech}\left (d x +c \right )^{2}}{2 d}-\frac {a \ln \left (\mathrm {sech}\left (d x +c \right )\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*sech(d*x+c)^2)*tanh(d*x+c),x)

[Out]

-1/2*b*sech(d*x+c)^2/d-1/d*a*ln(sech(d*x+c))

________________________________________________________________________________________

maxima [A]  time = 0.33, size = 27, normalized size = 0.93 \[ \frac {b \tanh \left (d x + c\right )^{2}}{2 \, d} + \frac {a \log \left (\cosh \left (d x + c\right )\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sech(d*x+c)^2)*tanh(d*x+c),x, algorithm="maxima")

[Out]

1/2*b*tanh(d*x + c)^2/d + a*log(cosh(d*x + c))/d

________________________________________________________________________________________

mupad [B]  time = 1.47, size = 72, normalized size = 2.48 \[ \frac {2\,b}{d\,\left (2\,{\mathrm {e}}^{2\,c+2\,d\,x}+{\mathrm {e}}^{4\,c+4\,d\,x}+1\right )}-\frac {2\,b}{d\,\left ({\mathrm {e}}^{2\,c+2\,d\,x}+1\right )}-a\,x+\frac {a\,\ln \left ({\mathrm {e}}^{2\,c}\,{\mathrm {e}}^{2\,d\,x}+1\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tanh(c + d*x)*(a + b/cosh(c + d*x)^2),x)

[Out]

(2*b)/(d*(2*exp(2*c + 2*d*x) + exp(4*c + 4*d*x) + 1)) - (2*b)/(d*(exp(2*c + 2*d*x) + 1)) - a*x + (a*log(exp(2*
c)*exp(2*d*x) + 1))/d

________________________________________________________________________________________

sympy [A]  time = 0.49, size = 42, normalized size = 1.45 \[ \begin {cases} a x - \frac {a \log {\left (\tanh {\left (c + d x \right )} + 1 \right )}}{d} - \frac {b \operatorname {sech}^{2}{\left (c + d x \right )}}{2 d} & \text {for}\: d \neq 0 \\x \left (a + b \operatorname {sech}^{2}{\relax (c )}\right ) \tanh {\relax (c )} & \text {otherwise} \end {cases} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sech(d*x+c)**2)*tanh(d*x+c),x)

[Out]

Piecewise((a*x - a*log(tanh(c + d*x) + 1)/d - b*sech(c + d*x)**2/(2*d), Ne(d, 0)), (x*(a + b*sech(c)**2)*tanh(
c), True))

________________________________________________________________________________________